package com.jdrx.api;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jdrx.beans.dto.ConsultDTO;
import com.jdrx.beans.vo.ResponseVO;
import com.jdrx.exception.BizException;
import com.jdrx.factory.ResponseFactory;
import com.jdrx.service.MailService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api("邮件发送")
@RestController
@RequestMapping("api/0/mail")
public class MailApi {
	@Autowired
	private MailService mailService;
	
	@ApiOperation(value = "邮件发送")
	@PostMapping(value = "send")
	public ResponseVO send(@RequestBody @Valid ConsultDTO dto) throws BizException {
		//mailService.send(dto);
		mailService.sendMaintenance(dto);
		return ResponseFactory.ok("操作成功");
	}
}